<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- <link rel="stylesheet" href="/static/css/index.css"> -->
</head>

<body>

    <input type="text">



    <h1>首页</h1>

    <a href="/static/html/login.html">登陆</a>

    <a href="/static/html/reg.html">注册</a>

    <!-- <script src="/static/js/a.js"></script> -->

    <script>

        // const xhr = new XMLHttpRequest();
        // xhr.open('get', '/api/users/login?user=yy&pass=12', true);
        // xhr.send();
        // xhr.onreadystatechange = function () {
        //     if (xhr.readyState === 4 && xhr.status === 200) {
        //         console.log(xhr.responseText);

        //     }
        // }


        // const xhr = new XMLHttpRequest();
        // xhr.open('get', '/api/goods/list', true);
        // xhr.send();
        // xhr.onreadystatechange = function () {
        //     if (xhr.readyState === 4 && xhr.status === 200) {
        //         console.log(xhr.responseText);

        //     }
        // }


        const xhr = new XMLHttpRequest();
        xhr.open('post', 'http://192.168.58.25:2000/api/users/login', true);
        xhr.setRequestHeader('content-type', 'application/x-www-form-urlencoded');
        xhr.send('user=qq&pass=666');
        xhr.onreadystatechange = function () {
            if (xhr.readyState === 4 && xhr.status === 200) {
                console.log(xhr.responseText);
            }
        }



        // const xhr = new XMLHttpRequest();
        // xhr.open('get', '/api/goods/listSearch?kw=小米', true);
        // xhr.send();
        // xhr.onreadystatechange = function () {
        //     if (xhr.readyState === 4 && xhr.status === 200) {
        //         console.log(xhr.responseText);

        //     }
        // }

    </script>

</body>

</html>